﻿@using PAMD
@using PAMD.Business.Models
@model PAMD.Business.Models.RegistrationModel
@{
    ViewBag.Title = SiteConstant.Slogan;
    Layout = "../Shared/_Layout.cshtml";
}
<script type="text/javascript" language="javascript">

    $(document).ready(function (event) {

        $('#SaveButton').click(function () {

            $('#termsError').hide();

            var validated = ValidateForm();

            var termAccepted = $('#terms').is(':checked');

            if (!termAccepted) {
                $('#termsError').show();
            }

            return validated && termAccepted;
        });

    });

</script>
@using(Html.BeginForm("Complete", "Register"))
{
<div class="form-container-small">
    <strong>Registration and listing of your space is completely free.</strong>
    <fieldset class="field-container">
        <div>
            <div>
                Your privacy is important to us. @SiteConstant.CompanyName does not rent or sell
                your personal information to third parties without your consent.
            </div>
            
           @if (!ViewData.ModelState.IsValid)
           {
               <div class="blue-box">
                   Email "@Model.Email" already registered, Please <a>login</a> using your email address.
               </div>
           }

            <div class="left-align">
                <div class="controlBox">
                    <label for="FirstName">
                        First Name&nbsp;</label>
                    @Html.TextBoxFor(m => m.FirstName, new { validation = "required", @class = "inputBox" })</div>
                <div id="FirstName_Error" class="error-box">
                    Please enter first name.
                </div>
            </div>
            <div class="left-align">
                <div class="controlBox">
                    <label for="LastName">
                        Last Name&nbsp;</label>
                    @Html.TextBoxFor(m => m.LastName, new { validation = "required", @class = "inputBox" })</div>
                <div id="LastName_Error" class="error-box">
                    Please enter last name.
                </div>
            </div>
            <div class="left-align">
                <div class="controlBox">
                    <label for="Email">
                        Email &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
                    @Html.TextBoxFor(m => m.Email, new { validation = "required,match,email", @class = "inputBox" })
                </div>
                <div id="Email_Error" class="error-box">
                    Please enter valid email address.
                </div>
            </div>
            <div class="left-align">
                <div class="controlBox">
                    <label for="Email2">
                        Confirm Email &nbsp;</label>
                    @Html.TextBoxFor(m => m.Email2, new { @class = "inputBox" })
                </div>
                <div id="Email_Match" class="error-box">
                    Email does not match the confirm email.
                </div>
            </div>
            <div class="left-align">
                <div class="controlBox">
                    <label for="Password">
                        Password &nbsp;</label>
                    @Html.PasswordFor(m => m.Password, new { validation = "required,match,minmaxLenght,4,25", @class = "inputBox" })
                </div>
                <div id="Password_Error" class="error-box">
                    Please enter password, Min 4 character.
                </div>
            </div>
            <div class="left-align">
                <div class="controlBox">
                    <label for="Password2">
                        Confirm Password &nbsp;</label>
                    @Html.Password("Password2", string.Empty, new { @class = "inputBox" })
                </div>
                <div id="Password_Match" class="error-box">
                    Password does not match the confirm password.
                </div>
            </div>
            <div class="left-align">
                <div class="controlBox">
                    <label for="Country">
                        Country &nbsp;</label>
                    @Html.DropDownListFor(m => m.Country, Model.Countries, new { validation = "required", @class = "inputBox" })
                </div>
                <div id="Country_Error" class="error-box">
                    Please select country.
                </div>
            </div>
            <div class="left-align">
                <div class="controlBox" style="padding: 8px;">
                    @Html.CheckBox("terms", new { @class = "left-align" })
                    <label style="margin: 0px; width: auto;" for="terms">
                        &nbsp; I agree to the following</label></div>
                <div id="termsError" class="error-box" style="display: none">
                    Please accept terms and conditions.
                </div>
            </div>
            <div class="left-align">
                <div class="controlBox">
                    <ul class="bullet">
                        <li>I accept the User Agreement which is the <a href="#">Terms Of Service</a> that apply
                            to my use of ParkingDelta, and have read the <a href="#">Privacy Policy</a>.
                        </li>
                        <li>I may receive communications from ParkingDelta and I understand that I can change
                            my notification preferences at any time in My ParkingDelta. </li>
                        <li>I am at least 18 years old. </li>
                    </ul>
                </div>
            </div>
            <div class="left-align">
                <label for="">
                    &nbsp;
                </label>
                <input type="submit" id="SaveButton" style="margin-left: 100px;" value="Create Account" />
            </div>
        </div>
    </fieldset>
</div>
}